﻿using OA.Model.MyAttribute;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace OA.Model
{
    [Table("Mailbox")]
    public class Mailbox : BaseInfo
    {
        /// <summary>
        /// 0:未读  1：已读
        /// </summary>
        public int Status { get; set; }


        public int CustomFormID { get; set; }

        public int FormID { get; set; }

        [MaxLength(20)]
        public string No { get; set; }

        [Required]
        [MaxLength(50)]
        public string Title { get; set; }

        [Required]
        [MaxLength(50)]
        public string FromDepartmentName { get; set; }

        [Required]
        [MaxLength(20)]
        public string FromPositionName { get; set; }

        [Required]
        [MaxLength(10)]
        public string FromEmpID { get; set; }

        [Required]
        [MaxLength(20)]
        public string FromEmpName { get; set; }

        [Required]
        [MaxLength(50)]
        public string ToDepartmentName { get; set; }

        [Required]
        [MaxLength(20)]
        public string ToPositionName { get; set; }

        [Required]
        [MaxLength(10)]
        public string ToEmpID { get; set; }

        [Required]
        [MaxLength(20)]
        public string ToEmpName { get; set; }

        public DateTime? ReadingTime { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [NotMapped]
        public string Pic { get; set; }

        [NotMapped]
        public string StatusName { get { if (this.Status == 0) { return "未读"; } else { return "已读"; }} }

    }
}
